package cn.memedai.router.demo;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import cn.memedai.router.RouteInterceptor;

/**
 * 自定义拦截器，通过注解指定name，就可以在Route中引用
 * <p>
 * Created by Cheney on 2017/3/6.
 */

public class SampleInterceptor implements RouteInterceptor {
    @Override
    public boolean intercept(Context context, @NonNull Uri uri, @Nullable Bundle extras) {
        return true;
    }

    @Override
    public void intercepted(Context context, @NonNull Uri uri, @Nullable Bundle extras) {
        Toast.makeText(context, "Intercepted by SampleInterceptor.", Toast.LENGTH_LONG).show();
    }
}
